package com.liugh.entity.standard;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 主要用于在上传和下载文件时保存原始文件名
 */
@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("original_name")
public class OriginnalName extends Model<OriginnalName> {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private int ID;

    /**
     * 远程文件名
     */
    @TableField("remote_name")
    private String remoteName;

    /**
     * 原始文件名
     */
    @TableField("original_name")
    private String originName;

    public OriginnalName(String remoteName, String originName) {
        this.remoteName = remoteName;
        this.originName = originName;
    }

    @Override
    protected Serializable pkVal() {
        return this.ID;
    }

}
